﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Data;
using System.Net;
using System.IO;
using System.Text;

namespace Z_Ymian.Controllers
{
    public class AdminController : Controller
    {
        //
        // GET: /Admin/
        public ActionResult Index()
        {
            return View();
        }
        /// <summary>
        /// 调用WEBapi
        /// </summary>
        /// <param name="uri"></param>
        /// <returns></returns>
        public static string PostDataGetHtml(string uri)
        {
            try
            {

                Uri uRI = new Uri(uri);
                HttpWebRequest req = WebRequest.Create(uRI) as HttpWebRequest;
                req.Method = "GET";
                req.KeepAlive = true;
                req.ContentType = "application/x-www-form-urlencoded";
                req.AllowAutoRedirect = true;

                //Stream outStream = req.GetRequestStream();

                //StreamReader sr = new StreamReader(outStream, Encoding.UTF8);
                //string htmlResult = sr.ReadToEnd();

                //return htmlResult;
                HttpWebResponse wr = req.GetResponse() as HttpWebResponse;

                string xml = new StreamReader(wr.GetResponseStream(), Encoding.UTF8).ReadToEnd();

                return xml;
            }
            catch (Exception ex)
            {
                return "网络错误：" + ex.Message.ToString();
            }
        }
        //面试经验文章详情页面
        public ActionResult ArtDetails()
        {
            return View();
        }
        /// <summary>
        /// 后台登陆街面
        /// </summary>
        /// <returns></returns>
        public ActionResult Admin_Login()
        {
            return View();
        }

    }
}
